#!/bin/bash

add(){
	read -p "please input your name:" u_name
	if id $u_name &>/dev/null
	then 
		echo "$u_name is exists"
		return 80
	else
		useradd $u_name
		return 90
	fi
}

result(){
	add
	if (($? == 80))
	then
		echo "add user is failed"
	else
		echo "add user ok"
	fi
}

result
